<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: khaki;
        }
        .item{
            border: 1px solid red;
            width: inherit; /*继承父元素的值*/
            height: inherit;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item">我是item</div>
    </div>
    
</body>
</html>